<table>
  <tbody>
#foreach($row in [1..2])
    <tr>
  #foreach($col in [1..2])
      <td>
    #if( $row == 1 && $col == 1)
        first cell
    #elseif( $row == 2 && $coll == 2)
        last cell
    #else
        middle cell
    #end
      </td>
  #end
    </tr>
#end
  </tbody>
</table>
